package com.baizhi.entity;

import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

public class Order {
    private Integer orderId;

    private String orderNo;

    private Double total;
	//订单日期
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	@JSONField(format = "yyyy-MM-dd")
    private Date orderDate;

    private Integer orderStatus;

    private User user;

    private Address address;

    private List<Item> items;

	public Order() {
		super();
	}

	public Order(Integer orderId, String orderNo, Double total, Date orderDate, Integer orderStatus, User user,
			Address address) {
		super();
		this.orderId = orderId;
		this.orderNo = orderNo;
		this.total = total;
		this.orderDate = orderDate;
		this.orderStatus = orderStatus;
		this.user = user;
		this.address = address;
	}

	public List<Item> getItems() {
		return items;
	}

	public void setItems(List<Item> items) {
		this.items = items;
	}

	public Integer getOrderId() {
		return orderId;
	}

	public void setOrderId(Integer orderId) {
		this.orderId = orderId;
	}

	public String getOrderNo() {
		return orderNo;
	}

	public void setOrderNo(String orderNo) {
		this.orderNo = orderNo;
	}

	public Double getTotal() {
		return total;
	}

	public void setTotal(Double total) {
		this.total = total;
	}

	public Date getOrderDate() {
		return orderDate;
	}

	public void setOrderDate(Date orderDate) {
		this.orderDate = orderDate;
	}

	public Integer getOrderStatus() {
		return orderStatus;
	}

	public void setOrderStatus(Integer orderStatus) {
		this.orderStatus = orderStatus;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Address getAddress() {
		return address;
	}

	public void setAddress(Address address) {
		this.address = address;
	}

	@Override
	public String toString() {
		return "Order [orderId=" + orderId + ", orderNo=" + orderNo + ", total=" + total + ", orderDate=" + orderDate
				+ ", orderStatus=" + orderStatus + ", user=" + user + ", address=" + address + "]";
	}




}